#ifndef __CELL_FACE_HPP__
#define __CELL_FACE_HPP__

#include "Engine/Plane.hpp"
#include "Engine/Vector3.hpp"

using namespace PocketSurvival::Engine;

namespace PocketSurvival
{
    struct CellFace
    {
        Point3 point;
        int32_t face;

        constexpr CellFace() noexcept;
        constexpr CellFace(int32_t x, int32_t y, int32_t z, int32_t face) noexcept;
        Plane calculatePlane() const;

        static int32_t OppositeFace(int32_t face);
        static Point3 FaceToPoint3(int32_t face);
        static Vector3 FaceToVector3(int32_t face);
        static int32_t Point3ToFace(Point3 point, int32_t maxFace = 5);
        static int32_t Vector3ToFace(Vector3 vector, int32_t maxFace = 5);
        static CellFace FromAxisAndDirection(int32_t x, int32_t y, int32_t z, int32_t axis, float direction);

        constexpr inline const Point3 &getPoint() noexcept;
    };

    constexpr CellFace::CellFace() noexcept : point(0,0,0), face(0) {}
    constexpr CellFace::CellFace(int32_t x, int32_t y, int32_t z, int32_t face) noexcept : point(x,y,z), face(face) {}

    constexpr inline const Point3 &CellFace::getPoint() noexcept
    {
        return point;
    }
    
} // namespace PocketSurvival


#endif
